UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PzlorJk69P8Toknt96SneBHysFnEYfPggykrhDVB114=' 
WHERE 
  key_id = '0bc1bceb293209592939fc326951d860264e7caf40be8d1aff667f79db264dad' 
  AND (
    token = 'PzlorJk69P8Toknt96SneBHysFnEYfPggykrhDVB114=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043