UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKiijY6yFAi8BhkI0Xmo6KofFSBuiVbCcNx2lYPyQQM=' 
WHERE 
  key_id = '572f58dd92d98505e8f063f827755513fc5f2be88eb56aa3ac1f4eac76a4abac' 
  AND (
    token = 'AKiijY6yFAi8BhkI0Xmo6KofFSBuiVbCcNx2lYPyQQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043