UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nw5boEKT0lFLtRp8FB5KVZ5v63jdJQVPiga6Z3DCZZo='
WHERE
key_id = '73d6cc5914b20a39cc3b1eb068309bde6b7924e6ebe7ab50f183c114d7b608bd'
AND (
token = 'nw5boEKT0lFLtRp8FB5KVZ5v63jdJQVPiga6Z3DCZZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)