UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uvTI5jdruAwn1sL9RvNMHytCpJbox5GEOiwNWV/qW48='
WHERE
key_id = 'ba6e87f6483edc1471080f97f7b8c22a5ee7c1615b2a380840b28318a0b1e04c'
AND (
token = 'uvTI5jdruAwn1sL9RvNMHytCpJbox5GEOiwNWV/qW48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)