UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'acmFZkeswZGEhDMa6EEAd03FC++C6MLj6ND2HbigzSc=' 
WHERE 
  key_id = '62413579e0cb3b69e80f6742a260c92e7a26c919f1757e97b174f1a6e7147372' 
  AND (
    token = 'acmFZkeswZGEhDMa6EEAd03FC++C6MLj6ND2HbigzSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040