UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dL9YfC06XZGS9Dn/5z0Fb1Qesn5PGL9EAtb4YCsOoPk='
WHERE
key_id = '01ef5d28b66fe68e1f542553dd1c7450121be8c663ca43ec813f9dd7b4524966'
AND (
token = 'dL9YfC06XZGS9Dn/5z0Fb1Qesn5PGL9EAtb4YCsOoPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)