UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2aJ8oNkf/7TYhXOxRVgFU/ZnNZ/mdqiPeymuw8OX83Q=' 
WHERE 
  key_id = '2a7c2408561dc98ea79a4f34ec84d04d97c77aa1087d6512eb2badab95dcc143' 
  AND (
    token = '2aJ8oNkf/7TYhXOxRVgFU/ZnNZ/mdqiPeymuw8OX83Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033