UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tPxyzJOoZJ0OO7YU0Rt+K209uEtWAxtIR1vm5HnoKOI='
WHERE
key_id = 'ccde418e75e1d0b7ba79e29dcf213789f938012fb9135e7a7333596295933ffa'
AND (
token = 'tPxyzJOoZJ0OO7YU0Rt+K209uEtWAxtIR1vm5HnoKOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)