UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9AHeK8thEadTHnOXo0ktHZdTr8cyqAFFY+/Wu7d6DbI='
WHERE
key_id = '193820c98868562b117fdcd46252b6266684dd26b46ed311d7ff83dde0ed3dab'
AND (
token = '9AHeK8thEadTHnOXo0ktHZdTr8cyqAFFY+/Wu7d6DbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)