UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ErBEpnqgmNFYU6SFkOHl+pFKiIG8WMxQTdnkEjx6PaE='
WHERE
key_id = '6356cad8cc301388879de89c31f0dc9fc8dd419f0ca7f06afc07b48fe5c3c1aa'
AND (
token = 'ErBEpnqgmNFYU6SFkOHl+pFKiIG8WMxQTdnkEjx6PaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)