UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1NTJNUp6uI2QugJH2ex5hUfQLzus/v3cUi2viT6zw4g='
WHERE
key_id = '909f1f473204d9605b9080df2a6d1d7a58ad57da8377125d8b9510d00e66a2a1'
AND (
token = '1NTJNUp6uI2QugJH2ex5hUfQLzus/v3cUi2viT6zw4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)