UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ATXzcimis/HSGG86U5IOaTa3/J++pynu0H4HSFWIMQ=' 
WHERE 
  key_id = 'be7b191adac90b1b5172302a4b3914952a792bc234134c6798622938c006a67b' 
  AND (
    token = '/ATXzcimis/HSGG86U5IOaTa3/J++pynu0H4HSFWIMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015