UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6/LGbD+Hx14gztTWC6UDHw5Zi8IyCBpjtUeQiKpyn78=' 
WHERE 
  key_id = 'ead057f24edc97ba7e08934eaad1ff158344d5a1db118d97e6ee443e89009a05' 
  AND (
    token = '6/LGbD+Hx14gztTWC6UDHw5Zi8IyCBpjtUeQiKpyn78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027