UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0UuFaxB4LIY3x1xIhFoFm+dxy9d4YYruW6t/PYcc56s='
WHERE
key_id = '475e6f439633d91493d36fd40e65fabd0e83a526e7e87b39eec0e5811d57a425'
AND (
token = '0UuFaxB4LIY3x1xIhFoFm+dxy9d4YYruW6t/PYcc56s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)