UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'td6jZ/KxJXr4piejI2zAjweRfx7lSaHEBXVFSXjRKkQ=' 
WHERE 
  key_id = '570e63cbcb5c2f0b47d68503bd52ff2a31b052a7067d3255d8ec9dbc472a2e66' 
  AND (
    token = 'td6jZ/KxJXr4piejI2zAjweRfx7lSaHEBXVFSXjRKkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033