UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HET/u29YLN6mxlJxYKGxQbEtz/gU57sxwug5hmKFgEM='
WHERE
key_id = '50d3e57580877fb6ade91d86f2818247aca8501980019d6ef3df75cac8fd87d3'
AND (
token = 'HET/u29YLN6mxlJxYKGxQbEtz/gU57sxwug5hmKFgEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)