UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TM0C4tGOe33uZNETHW3lM9FPb/aqv7K/kusbe2GXFXQ=' 
WHERE 
  key_id = '0ad02619e4cf7500dda8de946bf5711f25eff93c1f12616736b3fabb4fbd9c99' 
  AND (
    token = 'TM0C4tGOe33uZNETHW3lM9FPb/aqv7K/kusbe2GXFXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030