UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CRw+XDGCtihVOJDHlcfzuO9SywJiv5MtSHHNB0Q9/zQ='
WHERE
key_id = 'e6ef1d586c0e4e43858ffc3d8eec57130bbbc5a98cf2a77d059f1cc3b3f6dd4a'
AND (
token = 'CRw+XDGCtihVOJDHlcfzuO9SywJiv5MtSHHNB0Q9/zQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)