UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+fgrqrhUp6WPEUis/38PQ6YMeaz23iHlWCs83eSG6mI='
WHERE
key_id = '32b964be61b371aa4e67582d7596cb999a7460727f2d5eb765e42001e3496e7e'
AND (
token = '+fgrqrhUp6WPEUis/38PQ6YMeaz23iHlWCs83eSG6mI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)