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

Query time 0.00018