UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kvKFNIVXzrrn/oK2xlC+LepQRYOVMILaoxqzdHqQag4=' 
WHERE 
  key_id = 'bfda73fc9ffbdff9719257e61b0ad9c4197b639fbcce977b4d9252eefac887bd' 
  AND (
    token = 'kvKFNIVXzrrn/oK2xlC+LepQRYOVMILaoxqzdHqQag4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017