UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+SfEmrmIPIM5f1afYUQ8bg+XJ0CdSc8nk4A4HtSVoBM='
WHERE
key_id = '2d55774ee0d2ab97b6f54c370e2a55a9d9e200b58b8a768976c40815f90c9369'
AND (
token = '+SfEmrmIPIM5f1afYUQ8bg+XJ0CdSc8nk4A4HtSVoBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)