UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Iuvr+9VzdIilqeeei+3xFmdd8WL+qC6iUlw04Kb3Q8M='
WHERE
key_id = '4073c28e09d5f3f6722b1a989b57b462cab486034a5dce035484a6a2123160d8'
AND (
token = 'Iuvr+9VzdIilqeeei+3xFmdd8WL+qC6iUlw04Kb3Q8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)