UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lTfjAxXZ1CgcsZUccRzjArPVNpl+nkw+Ao1ZV2sfkdg='
WHERE
key_id = '922b20a05eaa26e0b17953ebd36cf2749fa53b6cf4c173845eb931c1c9976bcd'
AND (
token = 'lTfjAxXZ1CgcsZUccRzjArPVNpl+nkw+Ao1ZV2sfkdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)