UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zw2ogHqyCSZg4URGVruPdNdnmDkjTcchWu8EpKcee40='
WHERE
key_id = '72279534c989da815f74b69002ae37761888011f8e25077afe85eadc381ac1e8'
AND (
token = 'zw2ogHqyCSZg4URGVruPdNdnmDkjTcchWu8EpKcee40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)