UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOuenjVWZ4sxvYd3JZJdQt+jZ4sF/uz5y9VT5PTDVSM='
WHERE
key_id = 'e59be2826e9158cf7ad867d3615c267424266d35ae1db2e7f22da61978196cdb'
AND (
token = 'YOuenjVWZ4sxvYd3JZJdQt+jZ4sF/uz5y9VT5PTDVSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)