UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KJenKbdpVptNnRM6KSMgJfPED/8NMzh9bSHnfDPqaIM=' 
WHERE 
  key_id = '85818ff9300cd0b7d5e66a7b54b7ad1048ff5671e4ad0d4d161b3d98c68600ac' 
  AND (
    token = 'KJenKbdpVptNnRM6KSMgJfPED/8NMzh9bSHnfDPqaIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031