UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVmqmNgnj2rwOZW/AhXgcSXhj5q2M/3ySGjf+jGd4TI='
WHERE
key_id = 'f34947cdedcb582fe46096ad0bdd2bba1ed6d6b6110d288ad7fcb3a12b7e66de'
AND (
token = 'jVmqmNgnj2rwOZW/AhXgcSXhj5q2M/3ySGjf+jGd4TI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)