UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HZP+KSbpAp88QD9vrVkvYpJRGZ5x4cyjAJNo49qk8UU='
WHERE
key_id = 'ed6dcba510ad0f6dceccd61603e92f54388f10dcfa436c73ed1bfed5ed06085f'
AND (
token = 'HZP+KSbpAp88QD9vrVkvYpJRGZ5x4cyjAJNo49qk8UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)