UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8AwPB6D1avokbMne3scu8cHo9n9cAXTEfbr0yv45zr8='
WHERE
key_id = '6955d96a4bf775c4af99069df67606bbb318bbb57091ac806080f82b25efe3e2'
AND (
token = '8AwPB6D1avokbMne3scu8cHo9n9cAXTEfbr0yv45zr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)