UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ouBgv1U6B0m5FQ6pnc6EiuEN9B5/ZiWo65AMa8PqO0A=' 
WHERE 
  key_id = '88563a739f00980a3898c71f023fd42c6c5783b8a3070c89a8cd74f1a6f594e1' 
  AND (
    token = 'ouBgv1U6B0m5FQ6pnc6EiuEN9B5/ZiWo65AMa8PqO0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024