UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uJUTNTlIM5zkwRmAjb6owSd7Bh+V0x5t7BqXbj0O7SI=' 
WHERE 
  key_id = 'e07c3d5dcdcd298ef8c31e84400151ed502649b04e80925d7b5bf43d7f039d2d' 
  AND (
    token = 'uJUTNTlIM5zkwRmAjb6owSd7Bh+V0x5t7BqXbj0O7SI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028