UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1FpoPL3F1LmKCLQIcRo5BOm5ZhdwI+R4gO4UTfeV2x8=' 
WHERE 
  key_id = 'bcfd9485db3b3a42453dcb45f13f7b50bd06c94ae819437bd019866ef82d0d7b' 
  AND (
    token = '1FpoPL3F1LmKCLQIcRo5BOm5ZhdwI+R4gO4UTfeV2x8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043