UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n9pm79WjAlnDBooa0lfTLDIjmeGwVy1q+Qk+96rysiw=' 
WHERE 
  key_id = 'e6bd89a14cb51ff07e09b5f4400db846e7853f9b561af8bc1ec9ccf985d0e6b2' 
  AND (
    token = 'n9pm79WjAlnDBooa0lfTLDIjmeGwVy1q+Qk+96rysiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029