UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mGfUeBipZM/Ua7LCXlMB/FTD34N7r5bA4xAABILRqG8=' 
WHERE 
  key_id = '9a5a846bff7320debd61f4612741b65778b47d0636fc987e814ebab8b34bbb54' 
  AND (
    token = 'mGfUeBipZM/Ua7LCXlMB/FTD34N7r5bA4xAABILRqG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075