UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nM+Zzw8omEbJYVOCrsUv5caXpHafE9cWv7owJM0AasE=' 
WHERE 
  key_id = '9346c09e77e604d3c54961529e6e327d8a7f31d893d576ae35a6df85ccc006c7' 
  AND (
    token = 'nM+Zzw8omEbJYVOCrsUv5caXpHafE9cWv7owJM0AasE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019