UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQanvYAfiZP+iqyBRztg1iyat+bvx3QRHIBCWY1RsV0=' 
WHERE 
  key_id = 'ac4762da8e63b9ae4417eb2efa937a69ff83b3f6e4ae50db19b75b62c31703ee' 
  AND (
    token = 'tQanvYAfiZP+iqyBRztg1iyat+bvx3QRHIBCWY1RsV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040