UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NemtcPaX86oZTtfHOR5hUiBW3A0bhYCPccQ90cldGwo='
WHERE
key_id = 'e083cb664b7afee9b21a14173deb079734782362ffcc8b967330aeb28aec5994'
AND (
token = 'NemtcPaX86oZTtfHOR5hUiBW3A0bhYCPccQ90cldGwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)