UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VZ/06YHgLqAr6Q8axVbCRP5SAh7ETtjFenyNmiRxRL0=' 
WHERE 
  key_id = 'cf547b2f6aea7ecb95c2df6af3fa597cfc17960a23442f2fcb703a09e06702a2' 
  AND (
    token = 'VZ/06YHgLqAr6Q8axVbCRP5SAh7ETtjFenyNmiRxRL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032