UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H5f9zVWCCQ+9fMRLizc4Mp+5z2m+XKSFQGzUqi3H2+Y='
WHERE
key_id = '339d3fb203016a321d1f0f47b094c070f8965bd15ad60e2ff39b9c3f2762a089'
AND (
token = 'H5f9zVWCCQ+9fMRLizc4Mp+5z2m+XKSFQGzUqi3H2+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)