UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZxcn8Ps2EgJh+Pg+hkabJlVkCqS9VXD7rqtTeNUx/c=' 
WHERE 
  key_id = '0f34e3f8034008b8e7abdc76340a33d2ae0a98f6801daa6ad13136280673f704' 
  AND (
    token = 'lZxcn8Ps2EgJh+Pg+hkabJlVkCqS9VXD7rqtTeNUx/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028