UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4wx9TzvDEuS44LVJUxWexRk9wVgvU7hNRX5LV6EiJE='
WHERE
key_id = 'df7ae66b383b0ca41b5f50d4c84b5a885baf4b2226e6072f71f36d58ce210f16'
AND (
token = 'q4wx9TzvDEuS44LVJUxWexRk9wVgvU7hNRX5LV6EiJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)