UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'umHl7GDpdmuiQuu6CcEGxu+tPBaasDmMLtmsR6nmFc4='
WHERE
key_id = '70642f0237ae051463ea55658853fd607580fbf23c430fe8ff8c9c78aeba8391'
AND (
token = 'umHl7GDpdmuiQuu6CcEGxu+tPBaasDmMLtmsR6nmFc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)