UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P70MVZ66SG+YaZ5QNJh1dpAYye9s7Xi1o4po6oLGATI='
WHERE
key_id = '831595e386d8751e888c459e4b0f0de3417eb710a7236a2d7aec466441276aee'
AND (
token = 'P70MVZ66SG+YaZ5QNJh1dpAYye9s7Xi1o4po6oLGATI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)