UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OlT4GXGyg68ZSPnOiQNkc66qAjtRbJ17aVGOuT5HfDI=' 
WHERE 
  key_id = '74443419651f071ba3d57af59a194133578bc61540966236c932c3f8488ba74c' 
  AND (
    token = 'OlT4GXGyg68ZSPnOiQNkc66qAjtRbJ17aVGOuT5HfDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031