UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VYsBeY0DAdJwhf4zl8PC2PojAoxe3FxyprIGplk7xDQ='
WHERE
key_id = '006e5481c262ac7cfb7a3fe26e410df8139c65ff0cb892bd19d9c77de1564d4c'
AND (
token = 'VYsBeY0DAdJwhf4zl8PC2PojAoxe3FxyprIGplk7xDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)