UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnGYVkCnPh3FFd3zXsmqx86P2TblQy6+dFF1jVsdavk=' 
WHERE 
  key_id = '095f75f9ac3c1621587588a772dec33041bf896b0656a9eceee0464ccf43f789' 
  AND (
    token = 'vnGYVkCnPh3FFd3zXsmqx86P2TblQy6+dFF1jVsdavk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029